package com.kaaction.modules.ow.api;

import java.io.UnsupportedEncodingException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.dom4j.DocumentException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.kaaction.common.web.BaseController;
import com.kaaction.modules.ow.entity.OwIntention;
import com.kaaction.modules.ow.service.OwIntentionService;

@Controller
@RequestMapping(value = "/api/v1/owIntentionApi")
public class OwIntentionApiController extends BaseController{
	
	@Autowired
	OwIntentionService owIntentionService;
	
	/**
	 * 新增意向
	 * 
	 * @param request
	 * @param response
	 * @throws UnsupportedEncodingException
	 * @throws DocumentException
	 */
	@RequestMapping(value = "/intention",method = RequestMethod.POST)
	public void spuClassify(HttpServletRequest request, HttpServletResponse response)
			throws UnsupportedEncodingException, DocumentException {
		
		OwIntention owIntention = new OwIntention();
		
		String name = request.getParameter("name");//姓名
		String mobile = request.getParameter("mobile");//联系方式
		String intention = request.getParameter("intention");//意向
		
		owIntention.setName(name);
		owIntention.setMobile(mobile);
		owIntention.setIntention(intention);
		
		owIntentionService.save(owIntention);
	
		super.writeAjaxResponse(response,"");
	}
	
	

}
